import React from 'react'
import i18n from "i18next";
import { useTranslation, initReactI18next } from "react-i18next";
import { Select, Space } from 'antd';
function Index() {
     const { t , i18n} = useTranslation();
const handleChange = value => {
  console.log(`selected ${value}`);
  i18n.changeLanguage(value)
};
  return (
    <div>
        <Select
      defaultValue="en"
      style={{ width: 120 }}
      onChange={handleChange}
      options={[
        { value: 'en', label: '英文' },
        { value: 'zh', label: '中文' },
      ]}
    />
   <h2>{t('Welcome to React')}</h2>;
    </div>
  )
}

export default Index
